package com.chee.plant.hibernate.object.base;

import java.io.Serializable;

/**
 * This is an object that contains data related to the battle table. Do not
 * modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 * 
 * @hibernate.class table="battle"
 */

public abstract class BaseBattle implements Serializable {

	public static String REF = "Battle";
	public static String PROP_ID = "Id";
	public static String PROP_END_TIME = "EndTime";
	public static String PROP_START_TIME = "StartTime";
	public static String PROP_FIELD_ID = "FieldId";

	// constructors
	public BaseBattle() {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseBattle(java.lang.Integer id) {
		this.setId(id);
		initialize();
	}

	/**
	 * Constructor for required fields
	 */
	public BaseBattle(java.lang.Integer id, java.lang.Integer fieldId,
			java.util.Date startTime, java.util.Date endTime) {

		this.setId(id);
		this.setFieldId(fieldId);
		this.setStartTime(startTime);
		this.setEndTime(endTime);
		initialize();
	}

	protected void initialize() {
	}

	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.Integer id;

	// fields
	private java.lang.Integer fieldId;
	private java.util.Date startTime;
	private java.util.Date endTime;

	/**
	 * Return the unique identifier of this class
	 * 
	 * @hibernate.id generator-class="sequence" column="id"
	 */
	public java.lang.Integer getId() {
		return id;
	}

	/**
	 * Set the unique identifier of this class
	 * 
	 * @param id
	 *            the new ID
	 */
	public void setId(java.lang.Integer id) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}

	/**
	 * Return the value associated with the column: field_id
	 */
	public java.lang.Integer getFieldId() {
		return fieldId;
	}

	/**
	 * Set the value related to the column: field_id
	 * 
	 * @param fieldId
	 *            the field_id value
	 */
	public void setFieldId(java.lang.Integer fieldId) {
		this.fieldId = fieldId;
	}

	/**
	 * Return the value associated with the column: start_time
	 */
	public java.util.Date getStartTime() {
		return startTime;
	}

	/**
	 * Set the value related to the column: start_time
	 * 
	 * @param startTime
	 *            the start_time value
	 */
	public void setStartTime(java.util.Date startTime) {
		this.startTime = startTime;
	}

	/**
	 * Return the value associated with the column: end_time
	 */
	public java.util.Date getEndTime() {
		return endTime;
	}

	/**
	 * Set the value related to the column: end_time
	 * 
	 * @param endTime
	 *            the end_time value
	 */
	public void setEndTime(java.util.Date endTime) {
		this.endTime = endTime;
	}

	public boolean equals(Object obj) {
		if (null == obj)
			return false;
		if (!(obj instanceof com.chee.plant.hibernate.object.Battle))
			return false;
		else {
			com.chee.plant.hibernate.object.Battle battle = (com.chee.plant.hibernate.object.Battle) obj;
			if (null == this.getId() || null == battle.getId())
				return false;
			else
				return (this.getId().equals(battle.getId()));
		}
	}

	public int hashCode() {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId())
				return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":"
						+ this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}

	public String toString() {
		return super.toString();
	}

	private static final long serialVersionUID = 1L;
}